

package com.wavefront.mtl.parser.line;

import com.wavefront.mtl.elements.RGB;
import com.wavefront.obj.parser.LineParser;
import com.wavefront.obj.parser.MtlParser;

public class KaParser extends LineParser {

	RGB ambientRGB;

	@Override
	public void parse(String[] words) {
		super.parse(words);
		ambientRGB = new RGB();

		try {
			ambientRGB.setR(Float.parseFloat(words[1]));
			ambientRGB.setG(Float.parseFloat(words[2]));
			ambientRGB.setB(Float.parseFloat(words[3]));
			MtlParser.currentMaterial.setAmbient(ambientRGB);
		} catch (Exception e) {
			throw new RuntimeException("KdParser Error");
		}
	}

}
